package kit.msc.utility;

import kit.msc.gui.MainFrm;

public final class RestartManager {

	private static MainFrm mainFrm;

	public static void init(MainFrm mainFrame) {
		mainFrm = mainFrame;
	}

	public static void doRestart() {

		if (Preference.get("saveViewPosAtRestart", "true").equals("true")) {
			String activeCard = CardLayoutManager.getActiveCard();
			mainFrm.dispose();
			new Preference();
			mainFrm = new MainFrm(activeCard);
		} else {
			mainFrm.dispose();
			new Preference();
			mainFrm = new MainFrm(null);
		}

		mainFrm.setVisible(true);
	}

}
